package com.mg.framework.component;

import android.graphics.Canvas;
import android.view.MotionEvent;

import com.mg.framework.kernel.Assets;
import com.mg.framework.kernel.Screen;
import com.mg.framework.kernel.Touchable;

public class MenuScreen extends Screen implements Touchable {

	public MenuScreen(int width, int height) {
		super(width, height);
		this.addActor("start", new StartGame(this, Assets.start));
		this.addActor("exit", new ExitGame(this, Assets.exit));
	}

	@Override
	public void onTouchEvent(MotionEvent event) {
		String[] artors = { "start", "exit" };
		dispenseToActors(artors, event);
	}

	@Override
	public boolean isTouched(MotionEvent event) {
		return true;
	}

	@Override
	public void gameUpdate() {
		this.getBaseActor("start").gameUpdate();
		this.getBaseActor("exit").gameUpdate();
	}

	@Override
	public void screenUpdate(Canvas canvas) {
		this.getBaseActor("start").screenUpdate(canvas);
		this.getBaseActor("exit").screenUpdate(canvas);
	}
}
